<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body class="c1">
    <div class="c1">hello div <b id="b1">!</b></div>

    <script>
      const b1 = document.getElementById("b1");
      console.log(b1.closest("div"));
      console.log(b1.closest(".c1"));
    </script>
  </body>
</html>
